Skip to content

WIP: p2tr_ns #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 74 commits into
base: p2tr-v1
Choose a base branch
from
Draft

WIP: p2tr_ns #6

wants to merge 74 commits into from

Conversation

brandonblack
Copy link

No description provided.

- add `internalPubkey` and `redeems` fields
- add some temp comments
motorina0 and others added 23 commits February 22, 2022 13:57
* test: add PSBT example for taproot

* refactor: variable renaming

* refactor: use constant for tapscript leaf version

* feat: reuse redeem field for taproot spend

* test: make sure it defaults to tapscript version 192

* chore: remove `scriptLeaf` logic

* feat: add tapscript sign() a finalize() logic

* test: spend taproot script-path

* test: add tapscript for OP_CHECKSEQUENCEVERIFY

* feat: add multisig integration test

* refactor: rename scriptsTree to scriptTree (as per BP341)

* feat: check that the scriptTree is a binary tree

* feat: compute the redeem from witness; add unit tests

* test: add test for invalid redeem script

* feat: check the redeemVersion on the input data first

* test: add tests for taproot script-path sign, and key-path finalize
* Move the (much simplified) type check function to types.ts
* Use `Tapleaf` type a bit more (this might be a bad idea)
* Be more consistent in the capitalization of `Taptree`
Because the taggedHash API is typed, these are compile-time checked and
it's more clear w/o the constants.
* More clearly show the continuation and base cases in findScriptPath
* Return undefined not empty path when no path is found
  * This would lead to generating an invalid witness
* Tighten the type for HashTree to not allow 1-sided branch nodes
* Also added caching of `hashTree`, per todo.
* Added a test for this functionality
The spec uses this notation because in a spec there's no such thing as
reassigning a value. In real code it is appropriate to us accumulators
or such.
* refactor: explicit initialization on the ecc library

- remove optional `eccLib` parameter for `p2tr` and `psbt`
@brandonblack brandonblack force-pushed the p2tr-v1 branch 4 times, most recently from bd12ee6 to 79d14a7 Compare March 31, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants